import { get, put, _delete, post } from '@/lin/plugin/axios'
class Banner {
    static async getBanners(page = 0, count = 10) {
        const res = await get(
            'v1/banner/page',
            {
                page,
                count
            }
        )
        return res
    }
    static async getDetail(id) {
        const res = await get(`v1/banner/${id}`)
        return res
    }

    static async updateBanner(id, banner) {
        const res = await put(`v1/banner/${id}`, banner)
        return res
    }

    static async deleteBanner(id) {
        const res = await _delete(`v1/banner/${id}`)
        return res
    }

    static async addBanner(data) {
        const res = await post(`v1/banner`, data)
        return res
    }


}

export { Banner }
